#2490 Added version and profile information to GLData,#3280
#2490 Added version and profile information to GLData,#3280FluBBaOfWard wants to merge 1 commit intoeclipse-platform:masterfrom
Conversation
…, MacOS uses this to request a specific GL version.
| if (data.profile == Profile.CORE) { | ||
| attrib[pos++] = NSOpenGLPFAOpenGLProfile; | ||
| attrib[pos++] = NSOpenGLProfileVersion3_2Core; | ||
| } | ||
| if (data.profile == Profile.COMPATIBILITY) { | ||
| attrib[pos++] = NSOpenGLPFAOpenGLProfile; | ||
| attrib[pos++] = NSOpenGLProfileVersionLegacy; | ||
| } else { | ||
| if (data.majorVersion >= 4) { | ||
| attrib[pos++] = NSOpenGLPFAOpenGLProfile; | ||
| attrib[pos++] = NSOpenGLProfileVersion4_1Core; | ||
| } else if (data.majorVersion >= 3) { | ||
| attrib[pos++] = NSOpenGLPFAOpenGLProfile; | ||
| attrib[pos++] = NSOpenGLProfileVersion3_2Core; | ||
| } else { | ||
| attrib[pos++] = NSOpenGLPFAOpenGLProfile; | ||
| attrib[pos++] = NSOpenGLProfileVersionLegacy; | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
If data.profile == Profile.CORE, you're going to end up adding two profile attribute pairs to the array.
- First on lines 91-92, you'll add this pair:
(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core)
- Then when the test at line 94 fails you'll take the
elsepath at line 97, and depending whatdata.majorVersioncontains, you'll also add one of these three pairs:(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion4_1Core)(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core)(again!)(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersionLegacy)
That doesn't seem like what you'd want. Should line 94 be an else if? Or does the logic here need to be more robust? (The code starting at line 223 makes it seem like Profile.CORE should only be used with numbered versions, and Profile.COMPATIBILITY should be 1:1 with VersionLegacy, but that's not at all what the code here does.)
And then the comments even farther down claim that Profile is only valid if the major+minor version is at least 3.0. Meaning Profile.COMPATIBILITY is never actually a valid profile, because it's used when the version is "Legacy" (which seems implicitly to mean "less than 3.0")?
|
The Qt6 implementation of this is
So, in their model "Legacy" doesn't correspond to "Compatibility profile" at all, in fact it means that profiles are unsupported so neither Core nor Compatibility can be selected, the profile is "No profile". With versions >= 3.2, either the Core or Compatibility profile can be selected, though Apple's (deprecated) |
MacOS uses this to request a specific GL version.